CFLAGS:= -fopenmp
LDFLAGS:= -fopenmp
CXX:= gcc
PROG:= ex3
DESTDIR:=
PREFIX:=

OBJS:= main.o

all: $(PROG)

%.o: src/%.c src/%.h 
	$(CXX) $(CFLAGS) -c $<

$(PROG): $(OBJS)
	$(CXX) -Wall -Wextra -pedantic -g $(OBJS) -o $(PROG) $(LDFLAGS)

install: all
	@echo installing executable file to ${DESTDIR}${PREFIX}/bin
	@mkdir -p ${DESTDIR}${PREFIX}/bin
	@cp -f ${PROG} ${DESTDIR}${PREFIX}/bin
	@chmod 755 ${DESTDIR}${PREFIX}/bin/${PROG}

uninstall:
	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
	@rm -f ${DESTDIR}${PREFIX}/bin/${PROG}

clean:
	rm -f $(PROG) *.o